
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Docker使用Nginx代理转发SSR · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="docker-da-jian-ge-ren-wordpress-wang-zhan.html" />
    
    
    <link rel="prev" href="./" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介页
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../arcgis-api-for-javascript4.x/">
            
                <a href="../arcgis-api-for-javascript4.x/">
            
                    
                    ArcGIS API for JavaScript4.x
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../arcgis-api-for-javascript4.x/xue-xi-he-kai-fa-ji-qiao.html">
            
                <a href="../arcgis-api-for-javascript4.x/xue-xi-he-kai-fa-ji-qiao.html">
            
                    
                    学习技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../arcgis-api-for-javascript4.x/kai-fa-ji-qiao.html">
            
                <a href="../arcgis-api-for-javascript4.x/kai-fa-ji-qiao.html">
            
                    
                    开发技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../arcgis-api-for-javascript4.x/mapimagelayer.html">
            
                <a href="../arcgis-api-for-javascript4.x/mapimagelayer.html">
            
                    
                    MapImageLayer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../arcgis-api-for-javascript4.x/featurelayer.html">
            
                <a href="../arcgis-api-for-javascript4.x/featurelayer.html">
            
                    
                    FeatureLayer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../arcgis-api-for-javascript4.x/graphiclayer.html">
            
                <a href="../arcgis-api-for-javascript4.x/graphiclayer.html">
            
                    
                    GraphicLayer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../arcgis-api-for-javascript4.x/renderer.html">
            
                <a href="../arcgis-api-for-javascript4.x/renderer.html">
            
                    
                    Renderer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="../arcgis-api-for-javascript4.x/symbol.html">
            
                <a href="../arcgis-api-for-javascript4.x/symbol.html">
            
                    
                    2DSymbol
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="../arcgis-api-for-javascript4.x/di-tu-shi-jian.html">
            
                <a href="../arcgis-api-for-javascript4.x/di-tu-shi-jian.html">
            
                    
                    地图事件之地图状态监听
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="../arcgis-api-for-javascript4.x/di-tu-shi-jian-zhi-dian-ji.html">
            
                <a href="../arcgis-api-for-javascript4.x/di-tu-shi-jian-zhi-dian-ji.html">
            
                    
                    地图事件之点击
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10" data-path="../arcgis-api-for-javascript4.x/mo-ni-dian-yun-dong-tu-ceng.html">
            
                <a href="../arcgis-api-for-javascript4.x/mo-ni-dian-yun-dong-tu-ceng.html">
            
                    
                    模拟点运动图层
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.11" data-path="../arcgis-api-for-javascript4.x/untitled.html">
            
                <a href="../arcgis-api-for-javascript4.x/untitled.html">
            
                    
                    集成echarts实现迁徙图特效
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.12" data-path="../arcgis-api-for-javascript4.x/shi-xian-dian-ju-he-xiao-guo.html">
            
                <a href="../arcgis-api-for-javascript4.x/shi-xian-dian-ju-he-xiao-guo.html">
            
                    
                    实现点聚合效果
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../arcgis-api-for-javascript3.x.html">
            
                <a href="../arcgis-api-for-javascript3.x.html">
            
                    
                    ArcGIS API for JavaScript3.x
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../vue.html">
            
                <a href="../vue.html">
            
                    
                    VUE
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="./">
            
                <a href="./">
            
                    
                    Docker
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.5.1" data-path="docker-shi-yong-nginx-dai-li-zhuan-fa-ssr.html">
            
                <a href="docker-shi-yong-nginx-dai-li-zhuan-fa-ssr.html">
            
                    
                    Docker使用Nginx代理转发SSR
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="docker-da-jian-ge-ren-wordpress-wang-zhan.html">
            
                <a href="docker-da-jian-ge-ren-wordpress-wang-zhan.html">
            
                    
                    Docker搭建个人wordpress网站
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="docker-an-zhuang.html">
            
                <a href="docker-an-zhuang.html">
            
                    
                    Docker安装
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../nginx.html">
            
                <a href="../nginx.html">
            
                    
                    Nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../untitled.html">
            
                <a href="../untitled.html">
            
                    
                    小技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../ci-cd.html">
            
                <a href="../ci-cd.html">
            
                    
                    CI/CD
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Docker使用Nginx代理转发SSR</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="docker&#x4F7F;&#x7528;nginx&#x4EE3;&#x7406;&#x8F6C;&#x53D1;ssr">Docker&#x4F7F;&#x7528;Nginx&#x4EE3;&#x7406;&#x8F6C;&#x53D1;SSR</h1>
<p>SSR&#x7531;&#x4E8E;&#x4F7F;&#x7528;&#x7684;&#x662F;&#x56FD;&#x5916;&#x7684;VPS&#x7684;ip&#xFF0C;&#x4F1A;&#x6709;&#x5F88;&#x5927;&#x51E0;&#x7387;&#x88AB;&#x56FD;&#x5185;&#x7F51;&#x7EDC;&#x5C4F;&#x853D;&#xFF0C;&#x4F8B;&#x5982;&#x672C;&#x4EBA;&#x81EA;&#x642D;&#x7684;SSR&#x5728;&#x5BB6;&#x91CC;&#x4F7F;&#x7528;&#x7535;&#x4FE1;&#x7F51;&#x7EDC;&#x6CA1;&#x95EE;&#x9898;&#xFF0C;&#x5230;&#x516C;&#x53F8;&#x540E;&#x4F7F;&#x7528;&#x79FB;&#x52A8;&#x7F51;&#x7EDC;&#x88AB;&#x5C4F;&#x853D;&#x3002;</p>
<p>&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#x4E4B;&#x4E00;&#x5C31;&#x662F;&#x4F7F;&#x7528;&#x534E;&#x4E3A;&#x4E91;&#x7B49;&#x56FD;&#x5185;&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x884C;&#x4EE3;&#x7406;&#x8F6C;&#x53D1;&#xFF0C;&#x672C;&#x6587;&#x4ECB;&#x7ECD;&#x7684;&#x662F;&#x4F7F;&#x7528;docker&#x8FDB;&#x884C;Nginx&#x4EE3;&#x7406;&#x8F6C;&#x53D1;&#x3002;</p>
<p>nginx&#x914D;&#x7F6E;&#x6587;&#x4EF6;</p>
<pre><code>user  root;
worker_processes  1;

events {
    worker_connections  1024;
}

stream {

    upstream group1 {
        hash $remote_addr consistent;
        server 108.61.XXX.XXX:2333;     # ip:port
    }

    server {
        listen 2333;
        listen 2333 udp;
        proxy_pass group1;
    }

}
</code></pre><p>docker-compose.yml&#x6587;&#x4EF6;</p>
<pre><code>version: &apos;2&apos;
services:
  nginx_lb:
    image: nginx:latest
    ports:
     - &quot;2333:2333&quot;
     - &quot;2333:2333/udp&quot;
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
</code></pre><p> &#x4F7F;&#x7528;docker-compose&#x542F;&#x52A8;nginx</p>
<pre><code class="lang-text">docker-compose up -d
</code></pre>
<p>&#x542F;&#x52A8;&#x914D;&#x7F6E;SSR&#x8FDE;&#x63A5;,&#x7528;&#x56FD;&#x5185;&#x670D;&#x52A1;&#x5668;&#x7684;&#x516C;&#x7F51;ip&#x66FF;&#x6362;vps&#x7684;ip&#xFF0C;&#x5982;&#x56FE;</p>
<p><img src="../.gitbook/assets/image%20%2813%29.png" alt=""></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: Docker">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="docker-da-jian-ge-ren-wordpress-wang-zhan.html" class="navigation navigation-next " aria-label="Next page: Docker搭建个人wordpress网站">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Docker使用Nginx代理转发SSR","level":"1.5.1","depth":2,"next":{"title":"Docker搭建个人wordpress网站","level":"1.5.2","depth":2,"path":"docker/docker-da-jian-ge-ren-wordpress-wang-zhan.md","ref":"docker/docker-da-jian-ge-ren-wordpress-wang-zhan.md","articles":[]},"previous":{"title":"Docker","level":"1.5","depth":1,"path":"docker/README.md","ref":"docker/README.md","articles":[{"title":"Docker使用Nginx代理转发SSR","level":"1.5.1","depth":2,"path":"docker/docker-shi-yong-nginx-dai-li-zhuan-fa-ssr.md","ref":"docker/docker-shi-yong-nginx-dai-li-zhuan-fa-ssr.md","articles":[]},{"title":"Docker搭建个人wordpress网站","level":"1.5.2","depth":2,"path":"docker/docker-da-jian-ge-ren-wordpress-wang-zhan.md","ref":"docker/docker-da-jian-ge-ren-wordpress-wang-zhan.md","articles":[]},{"title":"Docker安装","level":"1.5.3","depth":2,"path":"docker/docker-an-zhuang.md","ref":"docker/docker-an-zhuang.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"docker/docker-shi-yong-nginx-dai-li-zhuan-fa-ssr.md","mtime":"2019-09-29T10:48:34.409Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-30T03:42:42.849Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

